package com.shengdong.water.code.utils

import android.content.Context
import android.widget.ImageView
import com.luck.picture.lib.engine.ImageEngine
import com.luck.picture.lib.utils.ActivityCompatHelper
import com.shengdong.water.code.ext.loadImage

class CoilEngine : ImageEngine {
    override fun loadImage(context: Context, url: String, imageView: ImageView) {
        if (!ActivityCompatHelper.assertValidRequest(context)) {
            return
        }
        imageView.loadImage(url)
    }

    override fun loadImage(
        context: Context,
        imageView: ImageView,
        url: String,
        maxWidth: Int,
        maxHeight: Int
    ) {
        if (!ActivityCompatHelper.assertValidRequest(context)) {
            return
        }
        imageView.loadImage(url)
    }

    override fun loadAlbumCover(context: Context, url: String, imageView: ImageView) {
        imageView.loadImage(url)
    }

    override fun loadGridImage(context: Context, url: String, imageView: ImageView) {
        imageView.loadImage(url)
    }

    override fun pauseRequests(context: Context?) {

    }

    override fun resumeRequests(context: Context?) {

    }
}